import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    settings: {
      showLogo: true,
      isCollapse: false,
      hasPageTab: true
    },
    checkCycle: null,
    routes: []
  },
  mutations: {
    toggleShowLogo({ settings }) {
      settings.showLogo = !settings.showLogo
    },
    toggleIsCollapse({ settings }) {
      settings.isCollapse = !settings.isCollapse
    },
    toggleHasPageTab({ settings }) {
      settings.hasPageTab = !settings.hasPageTab
    },
    setCheckCycle(state, payload) {
      state.checkCycle = payload
    }
  },
  actions: {
    setCheckCycle({
      commit
    }, payload) {
      commit('setCheckCycle', payload)
    }
  },
  modules: {
  }
})
